//
//  CommMacro.h
//  HTP
//
//
//  
//

#ifndef HTP_CommMacro_h
#define HTP_CommMacro_h

//常用系统项
#define APPBounds [UIScreen mainScreen].bounds
#define APPFrame  [UIScreen mainScreen].applicationFrame
#define APPNavBarH (self.navigationController.navigationBar.frame.size.height+self.navigationController.navigationBar.frame.origin.y)
#define SELFDELEGATE ((AppDelegate *)[[UIApplication sharedApplication] delegate])
#define USERCONTENT ([UserConten_default sharedInstance])
#define SYSTEMBACKIMAGE ([UIImage imageNamed:@"back"])
//通知掩藏tabbar
#define HIDDENTBARNotification @"HidenTabaar"
#define SHOWTABARNotification @"ShowTabar"
//通知 rootView跳转到下一个viewcontroller
#define ROOTGOTONEXTCONTROLLER @"roottonext"
#define IS_IPHONE() ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
#define IS_7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
#define ISMore(version) ([[[UIDevice currentDevice] systemVersion] floatValue] >= version)
#define UIFONTSYS(x) [UIFont fontWithName:@"Helvetica-Bold" size:x]
#define NavHe ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 ? 64:44)
//颜色
#define RGBCOLOR(A,B,C,P) [UIColor colorWithRed:A/255.0 green:B/255.0 blue:C/255.0 alpha:P]
#define NSLogFrame(Frame) NSLog(@"%@ " ,NSStringFromCGRect((Frame)))
#define MaxAB(A,B) (return A>B?A:B)
//不同版本版本类型差别定义
#define _TEXT_ALIGN_CENTER NSTextAlignmentCenter
#define _TEXT_ALIGN_LEFT NSTextAlignmentLeft
#define _TEXT_ALIGN_RIGHT NSTextAlignmentRight

#ifdef DEBUG
#   define DLog(fmt, ...) {NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);}
#   define ELog(err) {if(err) DLog(@"%@", err)}
#else
#   define DLog(...)
#   define ELog(err)
#endif


#endif
